<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title><h:outputText value="#{msg['app.name']}" /></title>
        <h:outputStylesheet name="css/default.css"/>
        <h:outputScript name="js/md5.js" />
        <h:outputScript name="js/passwd_md5.js" /> 
    </h:head>
    <h:body>    
        <div class="login">
            <p:graphicImage url="#{resource['images/logo.png']}" width="330" height="100"/>
            <br/>
            <p:fieldset style="background: none; width: 40%;">  
                <h:form id="login_form" style="alignment-adjust: central; text-align: center;">
                    <h:panelGrid id="login" columns="2" style="alignment-adjust: central; text-align: center;">
                        <h:outputLabel for="usuario" value="Usuario: " />
                        <p:inputText id="usuario" value="#{login.user.nick}" required="true" requiredMessage="Necesita ingresar un Usuario"/>

                        <h:outputLabel for="password" value="Contraseña: " />
                        <p:password id="password" value="#{login.user.pass}" required="true" requiredMessage="Necesita ingresar una Contraseña"/>
                    </h:panelGrid>
                    <br/>
                    <p:toolbar style="width: 100%;">
                        <f:facet name="right">
                            <p:commandButton type="reset" value="Cancelar" style="margin-right:20px"/>
                            <p:commandButton id="submit" value="Ingresar" onclick="passwd_md5();" action="#{login.doLogin()}" ajax="false" style="margin-right:20px"/>
                        </f:facet>
                    </p:toolbar>
                    <p:messages id="mensajes" showDetail="true" showSummary="false" autoUpdate="true" closable="true" />  
                </h:form>
            </p:fieldset>     
        </div>
    </h:body>
</html>